/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bayu.services.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Bayu
 */
@Entity
@Table(name = "preinspection")
@NamedQueries({@NamedQuery(name = "Preinspection.findAll", query = "SELECT p FROM Preinspection p"), @NamedQuery(name = "Preinspection.findById", query = "SELECT p FROM Preinspection p WHERE p.id = :id"), @NamedQuery(name = "Preinspection.findByDaily", query = "SELECT p FROM Preinspection p WHERE p.daily = :daily"), @NamedQuery(name = "Preinspection.findByAccum", query = "SELECT p FROM Preinspection p WHERE p.accum = :accum"), @NamedQuery(name = "Preinspection.findByDate", query = "SELECT p FROM Preinspection p WHERE p.date = :date")})
public class Preinspection implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Basic(optional = false)
    @Column(name = "daily")
    private double daily;
    @Basic(optional = false)
    @Column(name = "accum")
    private double accum;
     //Must edit @Basic for data tipe data
    @Basic()
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;

    public Preinspection() {
    }

    public Preinspection(Long id) {
        this.id = id;
    }

    public Preinspection(Long id, double daily, double accum, Date date) {
        this.id = id;
        this.daily = daily;
        this.accum = accum;
        this.date = date;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public double getDaily() {
        return daily;
    }

    public void setDaily(double daily) {
        this.daily = daily;
    }

    public double getAccum() {
        return accum;
    }

    public void setAccum(double accum) {
        this.accum = accum;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Preinspection)) {
            return false;
        }
        Preinspection other = (Preinspection) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bayu.services.entity.Preinspection[id=" + id + "]";
    }

}
